<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=7" />
	<title>“半价汇”广告管理系统</title>
	<!-- Reset Stylesheet -->
	<link rel="stylesheet" href="static/css/reset.css" type="text/css" media="screen" />
  
	<!-- Main Stylesheet -->
	<link rel="stylesheet" href="static/css/style.css" type="text/css" media="screen" />
	
	<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
	<link rel="stylesheet" href="static/css/invalid.css" type="text/css" media="screen" />	
	<script type="text/javascript" src="static/js/jquery.min.js"></script>
	<!-- jQuery Configuration -->
	<script type="text/javascript" src="static/js/simpla.jquery.configuration.js"></script>
	<script type="text/javascript" src="static/js/date.js"></script>
	<script type="text/javascript" src="static/js/jquery.datePicker.js"></script>
</head>
<body>
	<div id="body-wrapper">
		<?php include 'admin_sidebar.html'; ?>
		<div id="main-content">
			<div class="content-box">
				<div class="content-box-header">
					<h3>店铺列表</h3>
					<div class="clear"></div>
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
				<table cellpadding="10" cellspacing="10" class="" width="100%">
					<thead>
						<tr>
							<td colspan="3">
								<div class="bulk-actions align-left">
									<form action="<?php echo spUrl('store', 'search');?>" method="get" >
									<input type="hidden" name="c" value="store">
									<input type="hidden" name="a" value="mini_search">
									<input type="text" name="k" value="<?php if($kword) {echo $kword;} else { echo '店铺名称或店主名称';} ?>" onfocus="if(this.value=='店铺名称或店主名称') {this.value='';$(this).attr('style', 'color:#000')};" <?php if(!$kword) {?>style="color:#ccc;"<? } ?>>
									<select name="catid">
										<option value="0">请选择</option>
										<?php foreach($arr_cat as $k=>$v) {?>
										<option value="<?php echo $k; ?>" <?php if($k == $catid) echo 'selected'; ?>><?php echo $v; ?></option>
										<?php } ?>
									</select>
									<select name="store_level">
										<option value="">请选择等级</option>
										<option value="A" <?php if('A' == $store_level) echo 'selected'; ?>>A类</option>
										<option value="B" <?php if('B' == $store_level) echo 'selected'; ?>>B类</option>
										<option value="Other" <?php if('Other' == $store_level) echo 'selected'; ?>>其他</option>
									</select>
									<input type="submit" name="dosubmit" value="Go" class="button"/>
									</form>
								</div>
							</td>
						</tr>
						<tr>
							<th colspan="5">店铺名称</th>
						</tr>
					</thead>					
					<tr>
						<?php $i=0; foreach($results as $k=>$v) { ?>
						<td align="center" width="20%" style="overflow:hidden;"><?php echo $v['store_name'];?><br />(<a href="<?php echo spUrl('admin', 'post', array('store_id'=>$v['store_id']));?>" target="_blank">添加活动</a> <a href="http://shop<?php echo $v['store_id'];?>.taobao.com/" target="_blank">店铺首页</a> <a href="<?php echo spUrl('admin', 'search', array('store_id'=>$v['store_id']));?>" target="_blank">店铺活动</a>)</td>
						<?php $i++; ?>
						<?php if($i%4 == 0 && $i != 0) { ?></tr><tr><?php } ?>
						<?php } ?>
					</tr>
					 <tfoot>
						<tr>
							<td colspan="3">
							<div class="pagination">
								<div class="page-bottom tp">
									<?php if($pager[current_page] == $pager[first_page]) {?>
									<span class="page-start"><span><b class="icon"></b>上一页</span></span>
									<?php } else { ?>
									<a href="<?php echo spUrl('store', $a, array('page'=>$pager[prev_page], 'k'=>$kword, 'catid'=>$catid)); ?>" class="page-prev"><b class="icon"></b>上一页</a>
									<?php } ?>
									
									<?php if($pager[current_page] == $pager[last_page]) {?>
									<span class="page-end"><b class="icon"></b>下一页</span>
									<?php } else { ?>
									<a href="<?php echo spUrl('store', $a, array('page'=>$pager[next_page], 'k'=>$kword, 'catid'=>$catid)); ?>" class="page-next">下一页<b class="icon"></b></a>
									<?php } ?>
								</div>
							</div>
							<div class="clear"></div>
							</td>
						</tr>
					</tfoot>
				</table>
			</div>
		</div>
	</div>
</div>
</body>
</html>